package com.myapp.imp.war.msg;

import java.io.IOException;

import com.myapp.imp.war.logical.CGInserHeroLogical;
import com.myapp.msg.ann.MsgDefine;
import com.myapp.msg.base.BaseMsg;
import com.myapp.msg.type.MsgPermission;


/**
 * 文件名：CGInserHeroMsg.java
 * <p>
 * 功能：在指定地方放置一个英雄
 * <p>
 * 版本：1.0.0
 * <p>
 * 作者：Builderd by AppTools
 * <p>
 */
@MsgDefine(id = 10301, name = "CGInserHero", permission = MsgPermission.AUTHORIZE, logicalClass = CGInserHeroLogical.class)
public class CGInserHeroMsg extends BaseMsg {

	public CGInserHeroMsg(){
	}

	//英雄id
	private int heroId = 0;
			
	//放置英雄的x位置
	private int x = 0;
			
	//放置英雄的y位置
	private int y = 0;
			
	//英雄id的get方法
	public int getHeroId() {
		return heroId;
	}

	//英雄id的set方法
	public void setHeroId(int heroId) {
		this.heroId = heroId;
	}
	
	//放置英雄的x位置的get方法
	public int getX() {
		return x;
	}

	//放置英雄的x位置的set方法
	public void setX(int x) {
		this.x = x;
	}
	
	//放置英雄的y位置的get方法
	public int getY() {
		return y;
	}

	//放置英雄的y位置的set方法
	public void setY(int y) {
		this.y = y;
	}
	
	@Override
	public void read() throws IOException {
		//读取Field
		//读取英雄id
		this.setHeroId(this.readInt());
		
		//读取放置英雄的x位置
		this.setX(this.readInt());
		
		//读取放置英雄的y位置
		this.setY(this.readInt());
		
		//读取Bean
	}
	
	@Override
	public void write() throws IOException {
		//写入英雄id
		this.writeInt(this.getHeroId());
		
		//写入放置英雄的x位置
		this.writeInt(this.getX());
		
		//写入放置英雄的y位置
		this.writeInt(this.getY());
		
	}
}
